package main

import "fmt"

type dog struct {
	name string
	color string
	age int
}

func main()  {
	d1:=dog{"晓天","black",3}
	d2:=d1
	d2.name="小黑"
	fmt.Println(d1)
	fmt.Println(d2)

	d3:=new(dog)
	d3.name="二黄"
	d3.age=5
	d3.color="黄色"

	d4:=d3
	fmt.Printf("%T,%T\n",d3,d4)
	d4.name="大黄"
	fmt.Println(d3)
	fmt.Println(d4)

	d5:=&d1
	fmt.Printf("%T",d5)
	d5.name="黑狗"
	fmt.Println(d1,d5)
}
